package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SalaryChangeMapper;
import com.ruoyi.system.domain.SalaryChange;
import com.ruoyi.system.service.ISalaryChangeService;

/**
 * 薪资变更Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-16
 */
@Service
public class SalaryChangeServiceImpl implements ISalaryChangeService 
{
    @Autowired
    private SalaryChangeMapper salaryChangeMapper;

    /**
     * 查询薪资变更
     * 
     * @param id 薪资变更主键
     * @return 薪资变更
     */
    @Override
    public SalaryChange selectSalaryChangeById(Long id)
    {
        return salaryChangeMapper.selectSalaryChangeById(id);
    }

    /**
     * 查询薪资变更列表
     * 
     * @param salaryChange 薪资变更
     * @return 薪资变更
     */
    @Override
    public List<SalaryChange> selectSalaryChangeList(SalaryChange salaryChange)
    {
        return salaryChangeMapper.selectSalaryChangeList(salaryChange);
    }

    /**
     * 新增薪资变更
     * 
     * @param salaryChange 薪资变更
     * @return 结果
     */
    @Override
    public int insertSalaryChange(SalaryChange salaryChange)
    {
        salaryChange.setCreateTime(DateUtils.getNowDate());
        salaryChange.setUserId(SecurityUtils.getUserId());
        salaryChange.setProgress("0");
        return salaryChangeMapper.insertSalaryChange(salaryChange);
    }

    /**
     * 修改薪资变更
     * 
     * @param salaryChange 薪资变更
     * @return 结果
     */
    @Override
    public int updateSalaryChange(SalaryChange salaryChange)
    {
        salaryChange.setUpdateTime(DateUtils.getNowDate());
        return salaryChangeMapper.updateSalaryChange(salaryChange);
    }

    /**
     * 批量删除薪资变更
     * 
     * @param ids 需要删除的薪资变更主键
     * @return 结果
     */
    @Override
    public int deleteSalaryChangeByIds(Long[] ids)
    {
        return salaryChangeMapper.deleteSalaryChangeByIds(ids);
    }

    /**
     * 删除薪资变更信息
     * 
     * @param id 薪资变更主键
     * @return 结果
     */
    @Override
    public int deleteSalaryChangeById(Long id)
    {
        return salaryChangeMapper.deleteSalaryChangeById(id);
    }
}
